<?php
	include "include/common.inc.php";

	$currUser = getLoginUser();
	
	if($currUser->getValue("id") == -1)
		goToUrl("index.php");
		
		$user=$currUser;
		//print($user->getValue("id"));
	//$user = User::getUser($_GET[$currUser->getValue("id")]);	
	

?>

<!DOCTYPE html>
<!-- saved from url=(0040)http://getbootstrap.com/examples/signin/ -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<!--link rel="shortcut icon" href="http://getbootstrap.com/assets/ico/favicon.ico"-->
<title>Blind Dating</title>
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon">
<!-- Bootstrap core CSS -->
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="http://getbootstrap.com/examples/signin/signin.css" rel="stylesheet">
<!-- Just for debugging purposes. Don't actually copy this line! -->
<!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
		  <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
		  <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
		<![endif]-->
<style>
table, th, td
{
border:none;
border-collapse:collapse;
padding:8px;
}
table
{
width:350px;
border-spacing:30px;
}
body { padding-top: 50px; }
</style>
<script type= "text/javascript" src = "js/countries2.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="js/bootstrap.min.js"></script>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="index.php">NUS Blind Dating Site</a>
    </div>
	<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
	<ul class="nav navbar-nav">
	<li><a href="index.php">Home</a></li>
	
	 <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">Hello! <?php echo $currUser->getValue("userName"); ?> <b class="caret"></b></a>
          <ul class="dropdown-menu">
		  <li><a href="Myprofile.php">View My Profile</a></li>
		<li><a href="Editprofile.php">Edit My Profile</a></li>
        <li><a href="Groups.php">SeeGroup</a></li>
		<li><a href="Logout.php">Logout</a></li>
          </ul>
		  
        </li>
		</ul>
	</div>	
	</div>
	
</nav>


<div class="container" align="center">
<h2><?php echo $user->getValue("userName");?> Profile</h2>
<table>
  <tr>
    <th scope="row" width="40%" align="left" >Type</th>
    <td width="60%"><?php  if($currUser->getValue("type") == "1") echo "Admin"; else echo "Normal User";  ?></td>
    </tr>
  <tr>
  <tr>
    <th scope="row" width="40%" align="left" >First Name</th>
    <td width="60%"><?php echo $user->getValue("firstName"); ?></td>
    </tr>
  <tr>
    <th scope="row" align="left">Last Name</th>
    <td><?php echo $user->getValue("lastName"); ?></td>
    </tr>
  <tr>
    <th scope="row" width="40%" align="left" >Email</th>
    <td width="60%"><?php  echo $currUser->getValue("email")  ?></td>
  </tr>
  <tr>
  <tr>
    <th scope="row" align="left">Gender</th>
    <td><?php if($currUser->getValue("gender") == "Male") echo "Male"; else echo "Female"; ?></td>
    </tr>
  <tr>
    <th scope="row" align="left">Birthday</th>
    <td><?php echo extractDate($currUser->getValue("birthday")); ?></td>
    </tr>
  <tr>
    <th scope="row" align="left">Nation</th>
    <?php $city = City::getCityById($currUser->getValue("cityId")); ?>
    <td><?php echo $city->getValue("country"); ?></td>
    </tr>
   <tr>
    <th scope="row" align="left">City/District/State</th>
    <td><?php echo $city->getValue("name"); ?></td>
    </tr>
</table>
</div>
</body>
</html>